﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SGGWElevator
{
    /// <summary>
    /// Interaction logic for ElevatorControl.xaml
    /// Author: Adrian Surowik
    /// </summary>
    public partial class ElevatorControl : UserControl
    {
        public ElevatorControl()
        {
            InitializeComponent();

            // Hide unnecessery elevator caller buttons at top and bottom floors.
            ThirdFloorCaller.ArrowUpRow.Height = new GridLength(0);
            MinusOneFloorCaller.ArrowDownRow.Height = new GridLength(0);

            // Add all callers to the listw
            _elevatorCallers.Add(MinusOneFloorCaller);
            _elevatorCallers.Add(LobbyFloorCaller);
            _elevatorCallers.Add(FirstFloorCaller);
            _elevatorCallers.Add(SecondFloorCaller);
            _elevatorCallers.Add(ThirdFloorCaller);
        }

        public void UseDispatcher(Delegate deleg)
        {
            this.Dispatcher.Invoke(deleg);
        }

        public List<ElevatorCaller> ElevatorCallers { get { return _elevatorCallers; } }
        List<ElevatorCaller> _elevatorCallers = new List<ElevatorCaller>();
    }


}
